// 品牌管理页面相关api

import productRequest from '@/utils/productRequest'

// 获取品牌列表的接口
// /admin/product/baseTrademark/{page}/{limit}
export const reqTradeMarkList = (page, limit) => productRequest({ url: `/admin/product/baseTrademark/${page}/${limit}`, method: 'get' })

// 增加商品的接口  /admin/product/baseTrademark/save    post   data:{logoUrl:"string",tmName:"string"}
// 修改商品的接口  /admin/product/baseTrademark/update  put    data:{id:number,logoUrl:"string",tmName:"string"}
// 增加和修改的接口携带的参数一样，只有修改需要多携带一个id来确认修改的商品
export const reqAddTmOrUpdataTm = (tradeMark) => {
    if (!tradeMark.id) { //增加商品
        return productRequest({ url: "/admin/product/baseTrademark/save", method: 'post', data: tradeMark })
    } else { //修改商品
        return productRequest({ url: "/admin/product/baseTrademark/update", method: 'put', data: tradeMark })
    }
}

// 删除商品的接口
// /admin/product/baseTrademark/remove/{id}   DELETE
export const reqDeleteTradeMark = (id) => productRequest({ url: `/admin/product/baseTrademark/remove/${id}`, method: 'DELETE' })